const Router = require("koa-router");

const { auth } = require("../middleware/auth.middleware");

const {
  addCart,
  getCartList,
  deleteCart,
  updateCart,
} = require("../controller/cart.controller");

const router = new Router({ prefix: "/cart" });

// 加入购物车
router.post("/addCart", auth, addCart);

// 获取购物车列表
router.get("/getCartList", auth, getCartList);

//删除购物车商品
router.post("/deleteCart", deleteCart);

// 更改购物车状态
router.post("/updateCart", updateCart);

module.exports = router;
